home *** CD-ROM | disk | FTP | other *** search
- package symantec.itools.db.net;
-
- import java.io.DataInputStream;
- import java.io.DataOutputStream;
- import java.io.IOException;
- import java.util.Vector;
- import symjava.sql.SQLException;
-
- public class ServerList extends ServerObject {
- Vector _obj;
-
- ServerList(Vector obj) {
- this._obj = obj;
- }
-
- ServerList() {
- this._obj = new Vector();
- }
-
- public Vector getObjVector() {
- return this._obj;
- }
-
- public Vector toStringVector() {
- Vector v = new Vector();
-
- for(int i = 0; i < this._obj.size(); ++i) {
- NetString s = (NetString)this._obj.elementAt(i);
- v.addElement(new String(s.getString()));
- }
-
- return v;
- }
-
- int getType() {
- return 54;
- }
-
- void read(DataInputStream in) throws SQLException, IOException, ErrorException {
- in.readShort();
- this._obj = new Vector();
-
- while(true) {
- ServerObject obj = (ServerObject)NetClass.getNextObject(in);
- if (obj.getType() == 50) {
- return;
- }
-
- if (obj.getType() == 68) {
- ((ServerObject)this).onObjectError(obj);
- }
-
- this._obj.addElement(obj);
- }
- }
-
- void write(DataOutputStream out) throws IOException {
- out.writeByte(this.getType());
- out.writeShort(0);
-
- for(int i = 0; i < this._obj.size(); ++i) {
- ((ServerObject)this._obj.elementAt(i)).write(out);
- }
-
- EOT eot = new EOT();
- eot.write(out);
- }
- }
-